#!/bin/sh

if test x$1 = "x-uninstall"; then
	javaws -uninstall http://fsa-horaires.googlecode.com/svn/web/fsa-horaires.jnlp
	exit 0
fi

PATHS="/usr/lib/firefox* /usr/lib/mozilla*"

if test -z ${MOZILLA_FIVE_HOME}; then
	for p in ${PATHS}; do
		if test -e $p/libxpcom.so; then
			export MOZILLA_FIVE_HOME=$p
			break
		fi
	done
	if test -z ${MOZILLA_FIVE_HOME}; then
		echo "Mozilla installation not found, please set the environment variable"
		echo "MOZILLA_FIVE_HOME to the installation path of mozilla."
		exit 1
	fi
fi

echo "Using mozilla installation from ${MOZILLA_FIVE_HOME}"
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME} javaws http://fsa-horaires.googlecode.com/svn/web/fsa-horaires.jnlp

